package com.fafu.rbac.conterter;

import com.fafu.common.web.converter.BaseConverter;
import com.fafu.rbac.domain.entity.User;
import com.fafu.rbac.domain.vo.UserVO;

public class UserConverter extends BaseConverter<User, UserVO> {
    @Override
    protected UserVO entity2VO(User user) {
        if (user == null) {
            return null;
        }
        UserVO userVO = new UserVO();
        userVO.setId(user.getId());
        userVO.setNickname(user.getNickname());
        userVO.setAvatar(user.getAvatar());
        userVO.setGender(user.getGender());
        userVO.setBirth(user.getBirth());
        userVO.setUsername(user.getUsername());
        userVO.setTel(user.getTel());
        userVO.setWechat(user.getWechat());
        userVO.setState(user.getState());
        return userVO;
    }
}
